package davidtps.godutch.database.base;

import java.util.ArrayList;

import davidtps.godutch.activity.R;

import android.content.Context;

public class SQLiteDBConfig {

	private static final String DATABASE_NAME = "GoDutchDatabase.db";
	private static final int DATABASE_VERSION = 1;
	private static SQLiteDBConfig INSTANCE;
	private static Context mContext;
	
	private SQLiteDBConfig(Context pContext){
		mContext = pContext;
	}
	
	public static SQLiteDBConfig getInstance(Context pContext){
		if(INSTANCE==null){
			INSTANCE = new SQLiteDBConfig(pContext);
		}
		return INSTANCE;
	}

	public static String getDatabasename() {
		return DATABASE_NAME;
	}

	public static int getDatabaseversion() {
		return DATABASE_VERSION;
	}
	
	public static ArrayList<String> getTables(){
		ArrayList<String> _ArrayList = new ArrayList<String>();
		String[] _dalClassStrings = mContext.getResources().getStringArray(R.array.array_sqlite_dal_classname);
		String _PackageString = "davidtps.godutch.database.sqlitedal.";
		for(int i =0;i<_dalClassStrings.length;i++){
			String _String = _PackageString + _dalClassStrings[i];
			_ArrayList.add(_String);
		}
		return _ArrayList;
	}
	
}
